<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="<%=basePath %>admin/css/bootstrap.min.css" />
    <link rel="stylesheet" href="<%=basePath %>admin/css/dashboard.css" />
    <link rel="stylesheet" href="<%=basePath %>admin/css/dialog.css" />
</head>

<body>
<!--上部导航栏start-->
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">众筹管理平台</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">

            <ul class="nav navbar-nav navbar-right">
                <li><a href="<%=basePath %>/pages/index.action">首页</a></li>
                <li><a href="#">${admin.name}</a></li>
                <li><a href="#" title="修改个人资料和密码的页面">设置</a></li>
                <li><a href="#" title="退出登录">退出</a></li>
            </ul>
        </div>
    </div>
</nav>
<!--上部导航栏end-->
<div class="container-fluid">
    <div class="row">
        <!--左侧导航栏start-->
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar">
                <li ><a href="<%=basePath %>/pages/index.action">首页</a></li>
            </ul>
            <ul class="nav nav-sidebar">
               <li><a href="<%=basePath %>Projects/mav.action">所有项目*</a></li>
            <li><a href="<%=basePath %>Projects/projecReview.action">项目审核</a></li>
                <li class="active"><a href="<%=basePath %>Projects/trackingList.action">项目跟踪</a></li>
                <li><a href="<%=basePath %>Projects/productComments.action">项目评论</a></li>
            <li><a href="<%=basePath %>Projects/classity.action">项目分类*</a></li>
            <li><a href="<%=basePath %>Projects/recommend.action">项目推荐</a></li>
            </ul>
            <ul class="nav nav-sidebar">
               <li><a href="<%=basePath %>pages/backReg.action">注册管理员</a></li>
           <!--  <li><a href="">用户资金</a></li>
            <li><a href="">用户日志</a></li> -->
            <!-- <li><a href="">实名审核</a></li> -->
          </ul>
          <ul class="nav nav-sidebar">
            <li><a href="<%=basePath %>news/list.action">新闻管理</a></li>
            <li><a href="<%=basePath %>Projects/questionall.action">问题管理</a></li>
            <li><a href="<%=basePath %>adminLogin/adminList.action">管理用户</a></li>
           <!--  <li><a href="">管理日志</a></li> -->
            </ul>
        </div>
        <!--左侧导航栏end-->
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h1 class="page-header">众筹项目分类</h1>

            <div class="panel panel-default">
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-title">
                       项目分类列表   <a class="btn btn-primary" href="<%=basePath %>/pages/addTracking.action">添加</a>
                    </div>
                </div>
                <div class="panel-body">

                    <div class="table-responsive ">
                        <table class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>项目名称</th>
                                <th>项目进度状况</th>
                                <th>添加时间</th>
                                <th>发起人姓名</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${findAllSplit}" var="tracking">
                            <tr>
                                <td>${tracking.id }</td>
                                <td>${tracking.projects.name }</td>
                                <td>${tracking.schedule }</td>
                                <td><fmt:formatDate value="${tracking.time }" type="both"/></td>
                                <td>${tracking.user.name }</td>
                                <td>
                                    <a href="#" data-toggle="modal"
                                       data-target="#myModal" onclick="getTable(${tracking.id },'${tracking.projects.name }','${tracking.schedule }','<fmt:formatDate value="${tracking.time }" type="both"/>','${tracking.user.name}')">详情</a>
                                    <%-- <a href="#" onclick="getdel(${tracking.id})">删除</a> --%>
                                </td>
                            </tr>
                            </c:forEach>
                           
                            </tbody>
                        </table>
                    </div>
                    
                    <!--模态框-->
                    <div class="modal fade" id="myModal" tabindex="-1" role="dialog"
                         aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal"
                                            aria-hidden="true">&times;</button>
                                    <h4 class="modal-title" id="myModalLabel">分类详情</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form">
                                        <form class="form-validate form-horizontal" id="feedback_form" action="#" method="post" enctype="multipart/form-data">
                                            <div class="form-group ">
                                                <label for="p_id" class="control-label col-lg-2">序号<span
                                                        class="required"> *</span></label>
                                                <div class="col-lg-10">
                                                    <input class="form-control" id="p_id" name="id" type="text" readonly />
                                                </div>
                                            </div>

                                            <div class="form-group ">
                                                <label for="p_name" class="control-label col-lg-2">分类名称<span
                                                        class="required"> *</span></label>
                                                <div class="col-lg-10">
                                                    <input class="form-control" id="p_name" name="name" type="text" />
                                                </div>
                                            </div>
                                            <div class="form-group ">
                                                <label for="p_des" class="control-label col-lg-2">分类描述<span
                                                        class="required"> *</span></label>
                                                <div class="col-lg-10">
                                                    <input class="form-control" id="p_des" name="desc" type="text" />
                                                </div>
                                            </div>
                                            <div class="form-group ">
                                                <label for="p_time" class="control-label col-lg-2">添加时间<span
                                                        class="required"> *</span></label>
                                                <div class="col-lg-10">
                                                    <input class="form-control" id="p_time" name="starDate" type="text" readonly />
                                                </div>
                                            </div>
                                            <div class="form-group ">
                                                <label for="p_status" class="control-label col-lg-2">添加时间<span
                                                        class="required"> *</span></label>
                                                <div class="col-lg-10">
                                                    <input class="form-control" id="p_status" name="starDate" type="text" readonly />
                                                </div>
                                            </div>
                                          <!--   <div class="form-group" style="text-align: right;">
                                                <div class="col-lg-offset-2 col-lg-10">
                                                    <button class="btn btn-primary" type="button" id="update" onClick="upDate()">保存</button>
                                                    <button class="btn btn-default" type="reset">重置</button>
                                                </div>
                                            </div> -->
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="pager-info">
							<div>共有 ${findAllCount}条记录，第 ${currentPage}/${allPage} 页</div>
							<div>
								<ul class="pagination">
									<c:if test="${currentPage > 1}">
										<li><a
											href="<%=basePath %>Projects/trackingList.action?currentPage=${currentPage-1}&lineSize=${lineSize}">上一页</a>
										</li>
									</c:if>
									<c:if test="${currentPage <= 1}">
										<li class="paginate_button previous disabled }"><a
											href="#">上一页</a></li>
									</c:if>

									<c:forEach begin="1" end="${allPage}" step="1" var="pageNum">
										<c:if test="${currentPage eq pageNum }">
											<li class="paginate_button active"><a               
												href="<%=basePath %>Projects/trackingList.action?currentPage=${pageNum}">${pageNum}</a></li>
										</c:if>
										<c:if test="${currentPage ne pageNum }">
											<li class="paginate_button"><a
												href="<%=basePath %>Projects/trackingList.action?currentPage=${pageNum}">${pageNum}</a></li>
										</c:if>
									</c:forEach>
									<c:if test="${currentPage < allPage}">
										<li><a
											href="<%=basePath %>Projects/trackingList.action?currentPage=${currentPage+1}&lineSize=${lineSize}">下一页</a>
										</li>
									</c:if>
									<c:if test="${currentPage >= allPage}">
										<li class="paginate_button previous disabled }"><a
											href="#">下一页</a></li>
									</c:if>
								</ul>
							</div>
						</div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="<%=basePath %>admin/js/jquery1.12.4.min.js" ></script>
<script type="text/javascript" src="<%=basePath %>admin/js/bootstrap.min.js" ></script>
<script type="text/javascript" src="<%=basePath %>admin/js/countUp.js" ></script>
<script type="text/javascript" src="<%=basePath %>admin/js/dialog.js" ></script>
<script>
     function getTable(p_id,p_name,p_des,p_time,p_status){
        document.getElementById("p_id").value=p_id;
        document.getElementById("p_name").value=p_name;
        document.getElementById("p_des").value=p_des;
        document.getElementById("p_time").value=p_time;
        document.getElementById("p_status").value=p_status;
    }
     function getdel(id){
        javascript:$('body').dailog({type:'danger',title:'错误.',discription:'您确定要删除ID为'+id+'的数据吗?'},
            function(ret) { 
                if(ret.index===0){
                    window.location.href= "<%=basePath %>Projects/trackingList.action?id="+id;
                };
            })
    }
     function upDate(id){
    	 var form = new FormData(document.getElementById("feedback_form"));
    	 $.ajax({
    		 url : "<%=basePath %>Projects/multilist.action",
    		 method : "post",
    		 dataType : "json",
    		 data : form,
    		 processData:false,
    		 contentType: false,
    		 success : function(data){
    			 alert("++++++++" + data.msg); 
    		 },
    		 error : function(){
    				alert("修改失败!!!");
    		 }
    	 })
    	 
     }
   <%--  function confirmDelete(id){
    	if (confirm("确定要删除码？")) {
    		//alert('发送删除请求，刷新页面（不要异步）');
    		window.location.href = "<%=basePath%>Projects/projectsTypeRemove.action?id="+id;
    	}
    	return false;
    } --%>
</script>

</body>
</html>